<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<#include "/views/ftl/base/manager_include.ftl">
<script type="text/javascript" src="${basePath}js/My97DatePicker/WdatePicker.js"></script>
<head>
<style>
A{
color: #333;
}

</style>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>提现</title>
<script type="text/javascript">
$().ready(function() {
	$("#search_button").click(function(){
		$('#select_form').submit();
    });

    
    
});

</script>
</head>
<body style="background:#eef3f7;">
<#include "/views/ftl/base/head.ftl">
<div class="Main">
  <div class="dw">
<#include "/views/ftl/base/menu.ftl">


 <#function a>
 
 <#if tranVo.tranType??>
	 <#if ((tranVo.tranType)!'')==2>
	 <#return "提现列表_List"> 
	</#if>
 <#return "交易列表_List">
</#if>
 
 </#function> 


<!--右边内容-->
<div class="Rightbox fl">
    <!--导航-->
    <div class="Bread_crbs clear">
      <div class="Bread_crbs_img fl"></div>
      <div class="Bread_crbs_text fl">
      	<a href="javascript:void(0);"><span> 交易管理</span></a>
      	<span class="fnt_famy">></span>
      	<a href="javascript:void(0);"><span>
      	 <#if tranVo.tranType??>
      	 <#if ((tranVo.tranType)!'')==2>
		提现列表 
		</#if>
		交易列表
		</#if>
		</span></a>
      </div>
    </div>
      <!--搜索框-->
          <form id="select_form" name="select_form" action="${basePath}manager/Tran_findTranRecords" method="post">

           <span class="fl searchTitle" style="font-size: 14px;color: #333333;">付款或收款方:</span>
        	<div class="searchBox fl">
          		<div class="search_img fl"></div>
          		<input class="search_text" type="text" name="userId" placeholder="请输入用户ID" value="${(tranVo.userId?c)!''}"/>  
        	</div>
          <span class="fl searchTitle" style="font-size: 14px;color: #333333;">提现的账号:</span>
        	<div class="searchBox fl">
          		<div class="search_img fl"></div>
          		<input class="search_text" type="text" name="bankAccountId" placeholder="请输入账号" value="${(tranVo.bankAccountId?c)!''}"/>  
        	</div>
      	        <span class="fl searchTitle" style="font-size: 14px;color: #333333;">交易订单号:</span>
        	<div class="searchBox fl">
          		<div class="search_img fl"></div>
          		<input class="search_text" type="text" name="tranOrderId" placeholder="请输入交易订单号" value="${(tranVo.tranOrderId)!''}"/>  
        	</div>
          <br> <br> <br>
           <div class="input_name">
            <span>状态:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
          <select name="isFailStatus" id="isFailStatus" class="sp">
           <option value="3" <#if tranVo.isFailStatus==3>selected='true'</#if>>全部</option>
           <option value="0" <#if tranVo.isFailStatus==0>selected='true'</#if>>成功</option>
          <option value="1" <#if tranVo.isFailStatus==1>selected='true'</#if>>非成功</option>
        
          </select>
           <span>交易状态:&nbsp;&nbsp;</span>
          <select name="statusType" id="statusType"  class="sp"> 
          	<option value="10000" <#if tranVo.statusType==10000>selected='true'</#if>>全部</option>  
          	<#list tranStatusEnum as enum >  
          		<option value="${enum.statusType}" <#if (tranVo.statusType==enum.statusType)>selected='true'</#if>>${enum.statusDesc}</option>  
			</#list>
	 	</select> 
            <span>交易类型:&nbsp;&nbsp;</span> 
           <select name="tranType"  class="sp">
           	<option value="100" <#if tranVo.tranType==100>selected='true'</#if>>全部</option> 
           	<#list tranTypeEnum as enum >  
     			<option value="${enum.tranType}" <#if tranVo.tranType??><#if tranVo.tranType == enum.tranType>selected='true'</#if></#if> >${enum.description}</option>
			</#list>
          </select>
          </div> 
          <div class="input_name">
          <br>
            <span>开始时间:</span>
            <input type="name" name="startTime" readonly="readonly"  id="startTime" value="${(tranVo.startTime)!''}"  onclick="WdatePicker({dateFmt:'yyyy-MM-dd'})" type="text">
    		<span>结束时间:</span>
    		<input name="endTime" readonly="readonly"  value="${(tranVo.endTime)!''}" id="endTime"  onclick="WdatePicker({dateFmt:'yyyy-MM-dd'})" type="text">
    		<a href="javascript:void(0);" id="search_button" class="search_btn" style="  display: inline-block;"><span style="color:white;">搜索</span></a> 
         <br> </div> 
         <div class="input_name "> <span style="line-height: 28px;text-align: center;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;实收金额：${(sum)!''} 元</span></div>
        
       </form>
        <div class="clear"></div>
        <!--表格列表-->
        <div class="Table">
          <table id="table" cellpadding="0" cellspacing="1">
            <tbody>
              <tr id="gl">
              <td>交易订单号</td>
             <td>付款方</td>
             <td>收款方</td>
             <td>交易分类 </td>
             <td>订单详细描述</td>
             <td>总金额</td>
             <td>实收金额</td>
             <td>交易状态</td>
             <td>创建时间</td>
             <td>处理时间</td>
             <td>处理情况</td>
             <td>操作</td>
              </tr> 
              <#if (pager.list??)> 
         <#if ((pager.list?size)>0)>
          <#list pager.list as tran>
     		<tr>
			<td>${tran.tranOrderId}</td>
			<td><a href="${basePath }manager/User_userInfo?userId=${(tran.payUserId?c)}" target="_blank">${(tran.payUserId?c)}</a></td>
			<td><a href="${basePath }manager/User_userInfo?userId=${(tran.gainUserId?c)}" target="_blank">${(tran.gainUserId?c)}</a></td>
			<td>
			<#list tranTypeEnum as enum >  
				<#if (tran.tranType==enum.tranType)>${enum.description}</#if> 
			</#list>  
</td>
          	<td>${(tran.tranDesc)!''}</td>
            <td class="tdd50"> ${(tran.totalMoney)?c}</td>
             <td>${(tran.realMoney)?c}</td>
             <td>
             <#list tranStatusEnum as enum >  
				<#if (tran.statusType==enum.statusType)>${enum.statusDesc}</#if> 
			</#list>    
             </td>
             <td>${(tran.createTime)!''}</td>
             <td>${(tran.handleTime)!''}</td>
             <td>${(tran.handleDesc)!''}</td>
              <td class="tbl_btn tdd100"> 
              <a href="${basePath }manager/Tran_findTranInfo?tranOrderId=${(tran.tranOrderId)!''}" target="_blank"><span id="editor" class="_changeColor">查看</span></a>
              <a href="${basePath }manager/Tran_findTranRecords?userId=${(tran.gainUserId?c)}" target="_blank"><span id="editor">历史</span></a>
           <#if (tran.tranType==3)> <a href="${basePath }manager/UserOrder_findByTranId?tranId=${(tran.id)?c}" target="_blank"><span id="editor">订单</span></a></#if>
              </td>

              </tr>
            </#list >
          </#if>
          </#if>
            
            </tbody>
          </table>
        </div>
    <!--翻页按钮-->
  	<#import "../../base/pager.ftl" as p>
   	<@p.pager pager = pager baseUrl = "/manager/Tran_findTranRecords" parameterMap={"userId":(tranVo.userId?c)!'',"bankAccountId":(tranVo.bankAccountId?c)!'',"isFailStatus":(tranVo.isFailStatus)!'',"statusType":(tranVo.statusType)!'',"tranType":(tranVo.tranType)!'',"startTime":(tranVo.startTime)!'',"endTime":(tranVo.endTime)!'',"tranOrderId":(tranVo.tranOrderId)!''} /> 
</div>
<script type="text/javascript">
	$(function() {
		$("#isFailStatus").change(function(){
			find();
		});	
		function find() {
			$('#statusType').text('');
			var pid = $("#isFailStatus").val();
			$.ajax({
				url : "${basePath }manager/Tran_findStatusType",
				data : {
					isFailStatus : pid
				},
				dataType : "JSON",
				cache : false,
				type : "POST",
				success : function(dat) {
					var status='${(tranVo.statusType?c)}';
				 	var data =dat;
				 	var map = data.data; 
				 	$('#statusType').append("<option value='10000'  selected='true'>全部</option>");
						for (var key in map) { 
							var temp="";
							if(key==status){
								temp="selected='true'";
							} 
							$('#statusType').append("<option value='"+key+"' "+temp+"  >"+ map[key]+ "</option>");
						}
				}
			});
			
		}
		
		$('._changeColor').click(function(){
			$(this).css({"background":"#A0A0A0"});
		});
	});		
	
</script>
</body>
</html>

